<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../css/bootstrap-table.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table.min.js"></script>
    <script src="../../js/bootstrap-table-zh-CN.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

</head>
<body>

<table id="tab">

</table>

<script>
    $(function () {
        $("#tab").bootstrapTable({
            method: "post",
            contentType: "application/json",
            striped: true,
            pageNumber: 1,
            pageSize: 5,
            pagination: true,
            sidePagination: 'server',
            pageList: [1, 3, 5, 10],
            url: "/DispatchOrderQuery/QueryDispatchOrder",
            queryParams: function (params) {
                return {
                    // 计算页号(当前页)
                    pageNumber: (params.offset / params.limit) + 1,
                    // 计算页大小
                    pageSize: params.limit
                }
            },
            columns: [
                {title: '派序号编号', field: 'manufactureId', align: 'center',},
                {title: '产品编号', field: 'productId', align: 'center',},
                {title: '产品名称', field: 'productName', align: 'center',},
                {title: '投产数量', field: "amount", align: 'center'},
                {title: '合格数量', field: "testedAmount", align: 'center',
                formatter:function (value,row,index){
                    return (value==null? '<span class=\"btn btn-outline-success\">生产中</span>' :value);
                }},

                {title: '派工状态', field: "aa", align: 'center',
                formatter:function(value, row, index){
                    return "<span class=\"btn btn-outline-success\">已派工</span>";
                }},
                {title: "审核状态", field: "checkTag",align: 'center',
                    formatter: function (value, row, index) {
                        if (value=="s001-0"){
                            return "<span class=\"btn btn-outline-warning\">等待</span>";
                        }else if (value=="s001-1"){
                            return "<span class=\"btn btn-outline-success\">通过</span>";
                        }else{
                            return "<span class=\"btn btn-outline-dark\">不通过</span>";
                        }
                    }
                },
                {title: "生产状态", field: "manufactureProcedureTag",align: 'center',
                    formatter: function (value, row, index) {
                        if (value=="s002-0"){
                            return "<span class=\"btn btn-outline-warning\">待登记</span>";
                        }else if (value=="s002-1"){
                            return "<span class=\"btn btn-outline-danger\">未审核</span>";
                        }else{
                            return "<span class=\"btn btn-outline-success\">已完工</span>";
                        }
                    }
                }
            ]
        })
    })
</script>

</body>
</html>